package com.fjxd.user.service.impl;

import com.fjxd.feign.result.ViewResult;
import com.fjxd.user.mapper.UserMapper;
import com.fjxd.user.pojo.User;
import com.fjxd.user.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    private UserMapper userMapper;
    /*
     * 登录查询
     * */
    @Override
    public ViewResult findUserByUserAndPwd(User u) {
        User user=userMapper.findUserByUserAndPwd(u);
        if(user==null){
            return new ViewResult(ViewResult.Status.NOUSER.getCode(), ViewResult.Status.NOUSER.getMessage());
        }
        return ViewResult.success(user);
    }

}